package geppetto.reordering.graph.scorers;

import geppetto.cat.alignments.AlignmentsSet;
import geppetto.phraseHMM.phraseExtraction.extractedphrase.ExtractedPhrasePair;
import geppetto.phraseHMM.phraseExtraction.extractedphrase.SentenceInfo;
import geppetto.phraseScorer.AbstractPhraseScorer;
import geppetto.phraseScorer.WeightedPhraseScorerPhraseScorer;
import geppetto.reordering.graph.GraphWeightScorer;
import geppetto.reordering.graph.ReorderingGraph;

public class PhraseScoreScorer extends UnweightedGraphScorer{

	AbstractPhraseScorer scorer;

	public PhraseScoreScorer(AlignmentsSet set) {
		this(new WeightedPhraseScorerPhraseScorer(set));
	}
	
	public PhraseScoreScorer(AbstractPhraseScorer scorer) {
		this.scorer = scorer;
	}

	@Override
	public double scoreNode(ExtractedPhrasePair node) {
		if(ReorderingGraph.isStartNode(node) || ReorderingGraph.isEndNode(node)){
			return 1;
		}
		return scorer.getPhraseScore(node);
	}

	

}
